# !/bin/sh

# 镜像参数
docker_repostory=$docker_repostory
docker_registry_name=$docker_registry_name
project_artifactid=$project_artifactid
project_version=$project_version

# 构建镜像
docker build -t ${docker_repostory}/${docker_registry_name}/${project_artifactid}:${project_version} .

docker login $docker_repostory -u $REGISTRY_USERNAME -p $REGISTRY_PASSWORD

# 发布镜像
docker push ${docker_repostory}/${docker_registry_name}/${project_artifactid}:${project_version}

REGISTRY_USERNAME_OLD=$REGISTRY_USERNAME_OLD
REGISTRY_PASSWORD_OLD=$REGISTRY_PASSWORD_OLD
docker login $docker_repostory -u $REGISTRY_USERNAME_OLD -p $REGISTRY_PASSWORD_OLD
